package com.ts.main.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ts.main.admin.entity.ProductFileEntity;
import com.ts.main.admin.mapper.ProductFileMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lk
* @description 针对表【t_product_file(商品关联附件表)】的数据库操作Service实现
* @createDate 2025-06-09 00:56:13
*/
@AllArgsConstructor
@Slf4j
@Service
public class ProductFileServiceImpl extends ServiceImpl<ProductFileMapper, ProductFileEntity>{


    public Boolean deleteByProductId(Integer productId) {
        return remove(Wrappers.<ProductFileEntity>lambdaQuery().eq(ProductFileEntity::getProductId, productId));
    }

    public Boolean saveList(Integer productId, List<String> productImageTwo) {
        return baseMapper.saveList(productId,productImageTwo);
    }
}




